Account
The base account class. All types of accounts will subclass this object. This object maintains a list of sub-accounts, as well as the standard attributes associated with an account (name, type, currency, start balance, etc)
Properties
Returns the address book entry (if any) that is associated with this transaction.
If a syncable item is part of a grouped object, where multiple MoneydanceSyncableItems are part of the same syncable object, then this returns the parent object. An example is for SplitTxn which is not synced itself, but its associated ParentTxn is, so the SplitTxn class should override this method to return getParentTxn(). The default implementation here returns 'this'.
Return whether this account should be included in net worth balance calculations. This is only available as of build 754. NOTE: The accountOrParentIsInactive check was dropped as of MD2024.3(5202)
Quick check to determine whether this account is eligible for use in net worth calculations.
Return whether this item should be shown in the sidebar, which prefers a local file setting, followed by an object parameter, falling back to using defaultSidebarVisibility which returns true if the item would be expected to appear in the sidebar by default, such as in the case of bank, credit card, or investment accounts, or memorised reports and graphs.
Subclasses should override this to return a static string identifying their type of object
Return the starting balance without any adjustment applied
Functions
Add/merge all parameters from the given map that don't already have a key in the internal map
Set the TagSet associated with this object. This should only be called when initially constructing this object from old data files. In other words, DON'T USE THIS!
Adjust the starting balance by the given amount. This will add the given amount to the starting balance.
Return true if any changes to this object are automatically synced
indicates whether or not amounts in this account should be negated when displaying to user (will be true for Income accounts)
Returns true if transactions can be downloaded for this account
Compare the full path of this account to the full path of the given account
Return an integer indicating whether this account is less than, equal to, or greater than the given account when sorting by type, name, and ID. This method was added in build 600 (Moneydance 2008)
Deletes this item and writes a remove-item entry to the syncing system. Use with caution!
Return a clone of this object with the same backing info
make sure the account structure is correct and that the account's parent knows about it. This should only be called from the syncer or data loader upon the initial load
Make sure that the specified account is in the list of children for this account.
Lookup and return an account that was referenced by this object using one of the given parameter names. Priority is given to acctIDKey which should reference the UUID of the account being referenced. If the acctIDKey lookup is not successfull then a lookup is done using the acctNumKey which references the integer account ID that is returned by getAccountNum() on the referenced account. If either acctNumKey or acctIDKey is null then that key is not checked for an account reference.
Lookup and return an address book entry that was referenced by this object using one of the given parameter names. Priority is given to addressIDKey which should reference the UUID of the address being referenced. If the addressIDKey lookup is not successfull then a lookup is done using the addressNumKey which references the integer address ID that is returned by getID() on the referenced account. If either addressNumKey or addressIDKey is null then that key is not checked for an account reference.
Get the specified kind of balance for this account
Return the amount of the adjustment applied to the balance of this account. The returned amount will be added to the starting balances
Get the specified parameter as a boolean. If the given parameter does not have a value, or if it is not a boolean, return null
Get the specified parameter as a boolean. If the given parameter does not have a value, or if it is not a boolean, return the given default value
Return the check number selection/popup settings for this account. If this account has no specific settings, this returns the global settings which are associated with the root account if the returnDefaultIfNone flag is true. If the global account has no settings, this returns null and the default possibly-locale-specific settings should be used.
Gets a list of check numbers field strings associated with this account
Lookup and return the currency referenced by this object using the given parameter key
Lookup and return a currency that was referenced by this object using one of the given parameter names. Priority is given to currIDKey which should reference the UUID of the currency being referenced. If the currIDKey lookup is not successfull then a lookup is done using the currNumKey which references the integer account ID that is returned by getID() method on the referenced currency. If either currNumKey or currIDKey is null then that key is not checked for a currency reference.
Lookup and return a currency that was referenced by this object using one of the given parameter names. Priority is given to currIDKey which should reference the UUID of the currency being referenced. If the currIDKey lookup is not successfull then a lookup is done using the currNumKey which references the integer account ID that is returned by getID() method on the referenced currency. If no currency has been found then the parameter value associated with the currencyIDString key is checked for a currency ID string (usually the three character ISO currency ID). Any of the parameters currNumKey, currIDKey, or currencyIDString can be null in which case that parameter is not checked for a currency reference.
Get the default account that was stored with the given account ID key, presuming the given filter applies to it. If there was no such account or the filter is not matched, return the first account that does match the given filter.
Get the specified parameter as a double (64 bit) float. If the given parameter does not have a value, or if it is not an double, return the given defaul value
Returns the list of strings that was stored with setInlineStringListParameter, or null if the parameter has no value.
Get the specified parameter as an integer. If the given parameter does not have a value, or if it is not an integer, return the given defaul value
Get the specified parameter as a long. If the given parameter does not have a value, or if it is not a long, return null
Get the specified parameter as a long. If the given parameter does not have a value, or if it is not a long, return the given default value. This method was created as of build 254.
If this is an editing copy of an item, return the original
Get the specified parameter name. If the given parameter does not have a value, return the given defaultStr
Returns the parent (or this account) at the given depth. If the depth (i) is more than the depth of this account or less than zero then it returns null.
Returns the String value associated with the given key in the local data file-specific preferences
Returns the boolean value associated with the given key in the local data file-specific preferences. If it's not found in the local datastore then check this object's syncable parameters for the same key
Returns the boolean value associated with the given key in the local data file-specific preferences
Returns the double value associated with the given key in the local data file-specific preferences
Returns the integer value associated with the given key in the local data file-specific preferences
Returns an array of integers from in the local data file-specific preferences that were stored using setPreference(String, int[])
Returns the long value associated with the given key in the local data file-specific preferences
Return a list of string values that were stored with setPreference(key, ...) (ie in the local data file-specific preferences)
Returns a list of SyncRecord objects which were stored with setPreference(key, ...) in the local data file-specific preferences.
Returns a new SyncRecord with the key-value pairs for which the keys have the given prefix in the local data file-specific preferences.
Returns the starting balance for the account. As of Moneydance 2023, this starting balance has any user adjustments applied. To get the raw starting balance without adjustments use .getUnadjustedStartBalance()
Return a list of string values that were stored with setPreference(key, ...) (ie in the local data file-specific preferences)
Return a list of all immediate sub-accounts to this account.
Return a list of all accounts under this account matching the given filter. This includes accounts not just direct children but all accounts under this one in the hierarchy.
Returns a list of SyncRecord objects which were stored with setParameter(key, sublist)
Returns a SyncRecord map which was stored with setParameter(key, Map)
Returns true if this object has already been recorded as part of this data set. This can often be used to tell whether we're creating a new object or editing an existing one, for example in a transaction or account editor form.
Returns whether or not this debt account has an expiring rate (APR).
Returns true if the given account is equal to this account or if it is a direct or indirect sub-account of this account.
Returns true if this account is a descendant of the given account. That is, the given account exists above this one in the account hierarchy.
This is called after an item is updated by calling itemWasUpdated(SyncRecord). This can occur from the syncing process or from being loaded locally. Override this method to be notified.
This is called just before an item will be stored and/or synced when itemWillSync(SyncRecord) is called. Override this method to be notified or if you'd like to store anything into the info record to be synced.
Notify all listeners that the account has been modified.
Caution!! This can leave "orphan" transactions if an account that contains transactions is deleted.
Remove the parameter with the given name.
Caution!! This can leave "orphan" transactions if an account that contains transactions is deleted.
Store a reference to acct in this object using the given keys. The acctNumKey, if non-null, refers to the number returned by acct.getAccountNum(). The acctIDKey, if non-null, refers to the string returned by acct.getUUID() and will generally be more reliable and have a faster lookup time. If not storing references to accounts that have been migrated from before Moneydance 2015 then please only use the acctIDKey to store references.
Set or change the type of this account. Please be very careful with this as the account type determines a lot of behaviour in Moneydance and setting an account to a type that doesn't match the account's transactions or location in the account hierarchy could be bad.
Store a reference to address in this account using the keys. The acctNumKey, if non-null, refers to the number returned by address.getAccountNum(). The acctIDKey, if non-null, refers to the string returned by address.getUUID() and will generally be more reliable and have a faster lookup time. If not storing references to accounts that have been migrated from before Moneydance 2015 then please only use the acctIDKey to store references.
Set the balance adjustment for this account. The given amount will be added to the starting balance when recalculating balances for this account.
Sets a list of check numbers field strings associated with this account
Store a reference to the given currency in this object using the given parameter key.
Store a reference to currency in this object using the given keys. The currNumKey, if non-null, refers to the number returned by curr.getID(). The currIDKey, if non-null, refers to the string returned by curr.getUUID() and will generally be more reliable and have a faster lookup time. If not storing references to accounts that have been migrated from before Moneydance 2015 then please only use the acctIDKey to store references.
Store the given account as the default associated with the given account ID key
set the dirty flag for this account. If an account is dirty, it means that it has been changed since the last time it was saved. This does NOT fire any events that indicate the account was modified. Note: only available since build 260.
Put the object into "editing mode" in which no changes will be automatically saved until you call syncItem() on this. Note that calling duplicate() will put the new duplicate into editing mode automatically
Sets whether or not this debt account has an expiring rate (APR).
Store the given list of strings in a single parameter, instead of the parameter-per-item that setParameter(name, List) stores. Read it back with getInlineStringListParameter.
Set the online banking account ID for this account when used with the given online service ID (see OnlineService.getTIKServiceID()). To clear the association with a given online service, pass the serviceID and a null accountID.
Set the given parameter name to the given boolean value
Set the given parameter name to the given double value
Set the given parameter name to the given integer value
Set the given parameter name to the given long value
Set the given parameter name to the given value but don't notify listeners of changes!
Set the given parameter name to the given boolean value, without sending an account-changed event, or recording the account as dirty.
Set the given parameter name to the given integer value, without sending an account-changed event, or recording the account as dirty.
Set the given preference name to the given value and associate it with this object in local storage. This will not be synced and neither will it result in any modification notifications being triggered.
Saves the given sublist into local storage, associated with this object. Values can be retrieved using getPreferenceSublist(prefix).
Set the initial balance of this account without any user adjustments applied. When editing the starting balance, make sure to use the value returned from getUnadjustedStartBalance() as the starting point
Returns whether new or edited transactions in this account should have VAT applied.